package br.edu.unifei.cct720.alieninvasion.components.gui;

import br.edu.unifei.cct720.alieninvasion.main.gui.Game;
import br.edu.unifei.cct720.alieninvasion.patterns.Command;

/**
 * Class that instantiate a menu item to set up beginner level on the game
 * context
 * 
 * @author Felipe Knappe
 *
 */
public class JMenuItemBeginner extends javax.swing.JCheckBoxMenuItem implements Command {

	/** The main view of the game */
	private Game game;
	
	/**
	 * Class constructor
	 * Create a menu item for set up player beginner level
	 * 
	 * @param title The title of the menu item
	 * @param g The main view of the game which this component was added
	 */
	public JMenuItemBeginner(String title, Game g) {
		super(title);
		this.game = g;
	}
	
	/**
	 * Method responsible for handle events
	 * generated by the user on this
	 * component
	 * 
	 */
	@Override
	public void execute() {
		this.game.setUpBeginnerOptions();
	}
}
